class Queue:
    def __init__(self):
        self.stack = []
        self.help_stack = []

    def push(self, x):
        while self.stack:
            self.help_stack.append(self.stack.pop())
        self.help_stack.append(x)
        while self.help_stack:
            self.stack.append(self.help_stack.pop())

    def pop(self):
        return self.stack.pop()

    def peek(self):
        return self.stack[-1]

    def empty(self):
        return not bool(self.stack)
